-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sqllab): Add timeout on fetching query results #29959
feat(sqllab): Add timeout on fetching query results #29959
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #29959 +/- ##
===========================================
+ Coverage 60.48% 72.52% +12.03%
===========================================
Files 1931 1976 +45
Lines 76236 79638 +3402
Branches 8568 9072 +504
===========================================
+ Hits 46114 57759 +11645
+ Misses 28017 21155 -6862
+ Partials 2105 724 -1381
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@justinpark we currently have
Can't we reuse one of these for this? I'm thinking that we could expand the scope of |
Another question is about retry without time limit. Isn't this dangerous and probably inaccurate? I'm assuming all database engines will impose timeouts and this setting will not bypass this? I'm also assuming that a timeout was set for a reason, so giving users the ability to override this seems dangerous. If you're thinking about zombie frontend requests, wouldn't #29956 be sufficient to handle these cases? |
@michael-s-molina QUERY_RESULT_TIMEOUT is different from the existing SQLLAB_TIMEOUT and SQLLAB_ASYNC_TIME_LIMIT_SEC. This refers to a request that occurs in an ASYNC QUERY, which is different from the actual query execution time. It is a request to retrieve the completed query result from the cache. In formula form, it can be expressed as follows:
The reason for delays related to the timeout is due to locking caused by updates to the query table, which leads to delays in querying the information linked to the resultsKey of the query ID. To address this issue, a separate timeout is configured.
The locking delay in synchronizing query status was resolved with PR 29956. This patch also addresses the intermittent issue of the Making a request without a timeout applies the max request time related on the HTTP server, which is the same as the existing result retrieval process. The new addition is simply an update to the UX, where pending states are cut off slightly earlier than the HTTP server’s max request timeout. If a request requires more time than the configured timeout, users can re-initiate the request using the original method, depending on their preference. |
/testenv up |
@mistercrunch Ephemeral environment spinning up at http://34.215.131.40:8080. Credentials are |
60f8791
to
8778730
Compare
Ephemeral environment shutdown and build artifacts deleted. |
@sadpandajoe Could you add this fix on 4.1? |
(cherry picked from commit ff3b86b)
SUMMARY
This commit adds the timeout on fetching query results.
Additionally, a 'Retry without timeout' option is provided so that when a timeout issue occurs, users can attempt to proceed by ignoring the error.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
after--frontend-timeout.mov
TESTING INSTRUCTIONS
SET SQLLAB_QUERY_RESULT_TIMEOUT with a small timeout
Run a query async
Check the error message and then click "Retry" to get the result without timeout errors
ADDITIONAL INFORMATION